VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CXMLHTTP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private oXMLHTTP As ServerXMLHTTP
Private oCallBack As Object

Private Sub Class_Initialize()
    Set oXMLHTTP = New ServerXMLHTTP
    oXMLHTTP.onreadystatechange = Me
End Sub

Private Sub Class_Terminate()
    Set oXMLHTTP = Nothing
End Sub

Public Sub abort()
    oXMLHTTP.abort
End Sub

Public Sub setCallBack(obj As Object)
    Set oCallBack = obj
End Sub

Public Sub begin(url As String, Optional method As String = "GET", Optional bytData As Variant)
    oXMLHTTP.open method, url, True
    If method = "GET" Then
        oXMLHTTP.send
    Else
        oXMLHTTP.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
        oXMLHTTP.send bytData
    End If
End Sub

Public Sub OnComplete()
Attribute OnComplete.VB_UserMemId = 0
    If oXMLHTTP.readyState = 4 Then
        oCallBack.OnComplete oXMLHTTP
    End If
End Sub
